//
//  UILabel+RX.swift
//  mmda
//
//  Created by 李陆涛 on 2018/5/28.
//  Copyright © 2018年 mmda. All rights reserved.
//

import RxSwift
import RxCocoa
import UIKit

extension Reactive where Base: UILabel {
    
    var sex: Binder<Gender> {
        
        return Binder(base) {
            label, gen in
            
            switch gen {
                
            case .Man:
                label.text = "男"
            case .Woman:
                label.text = "女"
            }
        }
    }
    
    var birthday: Binder<Date> {
        
        return Binder(base) {
            
            label, bir in
            
            label.text = bir.string("yyyy-MM-dd")
        }
    }
}
